<div id="myOnPageContent" style="display:none;">	
	<!-- 公用浮层 -->
	<div class="fc_content base_fc" style="display:none">
		<form id="from_base_fc" action="#" method="GET">
			<div id="base_fc_content"></div>
			<input type="hidden" name="action" value="update_kjcx_contents" />
			<input type="button" class="buttons" onclick="check_user_input_base_fc('base_fc')" value="提交" id="tj_kdh"/>
		</form>
	</div>
	<!-- 公用浮层 -->
	
	<!-- 科技查新收费浮层 -->
	<div class="fc_content kjcx_sf" style="display:none">
		<form id="from_get_kjcx_sf" action="#" method="GET">
			<table class="kd_tab" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>收费模式：</td>
					<td>
						<select id="sf_kjcx_model" onchange="change_sf_model_kjcx('')" name="form[fkfs]">
						<option value="1">校内转账</option>
						<option value="2">校外现金付款</option>
						</select>
						<span id="sfgs_kjcx" style="display:none">收费公式：</span>
					</td>
				</tr>
				<tr>
					<td>查新号：</td>
					<td><input type="text" name="form[cxh]" id="kjcx_sf_cxh"  class="kd_inp"  value="" /></td>
				</tr>
				<tr>
					<td>基础费：</td>
					<td><input type="text" name="form[cxf]" id="kjcx_sf_cxf"  class="kd_inp"  value=""  onkeyup="get_Totalnum('kjcx_sf')"  /></td>
				</tr>
				<tr>
					<td>加急费：</td>
					<td><input type="text" name="form[jjf]" id="kjcx_sf_jjf"  class="kd_inp"  value=""  onkeyup="get_Totalnum('kjcx_sf')"  /></td>
				</tr>
				<tr>
					<td>报告费：</td>
					<td><input type="text" name="form[baogao_fy]" id="kjcx_sf_baogao_fy"  class="kd_inp"  value=""  onkeyup="get_Totalnum('kjcx_sf')"  /></td>
				</tr>								
				<tr>
					<td>总金额：</td>
					<td><input type="text" name="form[zfy]" id="kjcx_sf_zfy"  class="kd_inp"  value=""  /></td>
				</tr>	
				<tr>
					<td>交费凭单号：</td>
					<td><input type="text" name="form[sfpdh]" id="kjcx_sf_sfpdh"  class="kd_inp"  value=""   /></td>
				</tr>					
				<tr>
					<td>&nbsp;</td>
					<td style="text-align: left">
						<div class="buttondiv">
							<input type="button" class="buttons" onclick="check_user_input_base_fc('get_kjcx_sf')" value="提交" id="tj_kdh"/>
						</div>
					</td>
					<input type="hidden" name="action" value="update_kjcx_contents" />
				</tr>
			</table>
			<div id="kjcx_sf_content"></div>
		</form>
	</div>
	<!-- 科技查新收费浮层 -->
	<!-- 科技查新增加费用 -->
	<div class="fc_content kjcx_add_sf" style="display:none">
		<form id="from_get_kjcx_add_sf" action="#" method="post">
			<table class="kd_tab" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>增加费用：</td>
					<td><input type="text" id="kjcx_add_sf_baogao_fy" name="form[zzfy]" class="kd_inp"  value="" onkeydown="onlyNum();"/></td>
				</tr>								
				<tr>
					<td>添加原因：</td>
					<td><textarea rows="5" style="width:300px;" name="form[shyy]" class="textarea"></textarea></td>
				</tr>						
				<tr>
					<td>&nbsp;</td>
					<td style="text-align: left">
						<div class="buttondiv">
							<input type="button" class="buttons" onclick="check_user_input_base_fc('get_kjcx_add_sf')" value="提交" id="tj_kdh"/>
						</div>
					</td>
					<input type="hidden" name="action" value="update_kjcx_contents" />
				</tr>
			</table>
			<div id="kjcx_add_sf_content"></div>
		</form>
	</div>
	<!-- 科技查新增加费用 -->
	
	<!-- 科技查新收费浮层 -->
	<div class="fc_content sf_zt" style="display:none">
		<form id="from_get_sf_zt" action="#" method="post">
			<table class="kd_tab" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>收费模式：</td>
					<td>
						<select id="sf_kjcx_model" onchange="change_sf_model_kjcx('')" name="form[fkfs]">
						<option value="1">校内转账</option>
						<option value="2">校外现金付款</option>
						</select>
					</td>
				</tr>
				<tr>
					<td>缴费状态：</td>
					<td>
						<div class="divspan">
							<span><input class="radio" type="radio" value="" checked="checked" name="form[zfy_sh]"> 未缴费</span>
							<span><input class="radio" type="radio" value="1" name="form[zfy_sh]"> 已缴费</span>
							<span><input class="radio" type="radio" value="2" name="form[zfy_sh]"> 预缴费</span>
						</div>
					</td>
				</tr>					
				<tr>
					<td>&nbsp;</td>
					<td style="text-align: left">
						<div class="buttondiv">
							<input type="button" class="buttons" onclick="check_user_input_base_fc('get_sf_zt')" value="提交" id="tj_kdh"/>
						</div>
					</td>
					<input type="hidden" name="action" value="update_kjcx_contents" />
				</tr>
			</table>
			<div id="sf_zt_content"></div>
		</form>
	</div>
	<!-- 科技查新收费浮层 -->
	
	
	<!-- 显示日志 -->
	<div class="fc_content fc_log" style="display:none">
		<div id="fc_log_content"></div>
	</div>
	<!-- 显示日志 -->
	
	<!-- 选择人员浮层 -->
	<div class="fc_content fc_user" style="display:none">
		<form id="from_fc_user" action="#" method="post">
			<select id="fc_user_select"  name="form[now_user_name]" multiple="multiple" style="width:100%"></select>
			<div id="fc_user_content"></div>
			<input type="hidden" name="action" value="update_kjcx_contents" />
			<input type="button" class="buttons" onclick="check_user_input_base_fc('fc_user')" value="提交" id="tj_kdh"/>
		</form>
	</div>
	<!-- 选择人员浮层 -->
	
	<!-- 上传附件 -->
	<div class="fc_content fc_upload fc_upload_see" style="display:none">
	
		<form id="from_fc_upload" action="#" method="post">
             <div class="controls input input-file" for="file">
                 <div class="button">
                     <input type="file" onchange="ajaxFileUpload_gy('icoA');" id="icoA" name="icoA">
                 </div>
             </div>
			<div class="show_file" id="show_upload_message_sqfj"></div><!-- 显示已经上传的附件 -->
		</form>
		
	</div>
	<!-- 上传附件 -->
	
	<!-- 电子报告 -->
	<div class="fc_content fc_report" style="display:none">
	<form id="from_fc_report" action="#" method="post">
		<input type="text" name="form[file_name]" />
		<input type="button" class="buttons" onclick="check_user_input_base_fc('fc_report')" value="提交" id="tj_kdh"/>
		<div id="fc_report_content"></div>
		<input type="hidden" name="action" value="update_kjcx_contents" />
	</form>
	<div id="fc_report_div"></div>
	</div>
	<!-- 电子报告 -->
</div>

<script type="text/javascript">
var save_id 		= 	'';
var save_menu_id 	= 	'';
var save_task_id	=	'';

function open_fc(id,menu_id,task_id)
{
	save_id 	 = id;
	save_menu_id = menu_id;
	save_task_id = task_id;
	
	if(id == 'fc_upload')
	{
		$('#sqfj_upload').show();
	}
	else
	{
		$('#sqfj_upload').hide();
	}
	
	//
	$.ajax
	(
		{
			type:'get',//可选get
			url:'ajax_control.html',//这里是接收数据的PHP程序
			data:'action=get_kjcx_message&form[menu_id]='+menu_id+'&form[task_id]='+task_id,
			dataType:'json',
			success:function(msg)
			{
				switch(id)
				{
					case 'base_fc':
						$('#base_fc_content').html('');
						 for(var key in msg.contents)
						 {
							if(key != 'id')
							{
								if(key	== 'bh_contents'){
									$('#base_fc_content').append('<textarea rows="5" style="width:300px;" name="form['+key+']" class="textarea"  id="'+key+'"></textarea>');
								}else{
									$('#base_fc_content').append('<input class="kd_inp" type="text" id="'+key+'" name="form['+key+']" />');
								}
								 $('#'+key).val(msg.contents[key]); 
							}
						 }
					break;
					case 'fc_user'://显示人员列表
						$('#fc_user_select').html('');
						for(var key in msg.contents)
						{
							$("#fc_user_select").append("<option value='"+msg.contents[key].id+"'>"+msg.contents[key].username+"</option>");
						}
					break;
					case 'fc_log'://显示日志
						$('#fc_log_content').html('');
						if(msg.type == 'log')
						{
							txtHtml = "<table cellspacing='1' cellpadding='1' width='100%'>";
							txtHtml += "<tr>";
							txtHtml += "<th>时间</th>";
							txtHtml += "<th>操作人员</th>";
							txtHtml += "<th>所在流程</th>";
							txtHtml += "<th>事件</th>";
							txtHtml += "</tr>";
							for(var key in msg.contents)
							{
								txtHtml += "<tr>";
								txtHtml += "<td>"+msg.contents[key].intime+"</td>";
								txtHtml += "<td>"+msg.contents[key].user_bh+"</td>";
								txtHtml += "<td>"+msg.contents[key].process_id+"</td>";
								txtHtml += "<td>"+msg.contents[key].contents+"</td>";
								txtHtml += "</tr>";
							}
						}
						else if(msg.type == 'sf_list')
						{
							txtHtml = "<table cellspacing='1' cellpadding='1' width='100%'>";
							txtHtml += "<tr>";
							txtHtml += "<th>时间</th>";
							txtHtml += "<th>操作人员</th>";
							txtHtml += "<th>收费</th>";
							txtHtml += "<th>说明</th>";
							txtHtml += "</tr>";
							
							for(var key in msg.contents)
							{
								txtHtml += "<tr>";
								txtHtml += "<td>"+msg.contents[key].intime+"</td>";
								txtHtml += "<td>"+msg.contents[key].user_name+"</td>";
								txtHtml += "<td>"+msg.contents[key].fy+"</td>";
								txtHtml += "<td>"+msg.contents[key].abs+"</td>";
								txtHtml += "</tr>";
							}
						}
						$('#fc_log_content').html(txtHtml);	
						
					break;
					case 'fc_upload':
					case 'fc_upload_see':
						show_file_message(msg);
					break;
					case 'fc_report':
						show_doc_file(msg)
					break;
					case 'kjcx_sf':
						//第一步：赋基本值
						$('#'+id+'_cxh').val(msg.contents.cxh);
						$('#'+id+'_cxf').val(msg.contents.cxf);
						$('#'+id+'_jjf').val(msg.contents.jjf);
						$('#'+id+'_baogao_fy').val(msg.contents.baogao_fy);
						$('#'+id+'_charge').val(msg.contents.charge);
						$('#'+id+'_sfpdh').val(msg.contents.sfpdh);
						$('#'+id+'_zfy').val(msg.contents.zfy);
						$('#'+id+'_zfy_sh').val(msg.contents.zfy - msg.contents.charge);
					break;
					case 'kjcx_add_sf':
						//第一步：赋基本值
						$('#'+id+'_zfy').val(msg.contents.zfy);
					break;
				}
				 $('#'+id+'_content').append('<input type="hidden" value="'+menu_id+'" name="form[menu_id]" />');
				 $('#'+id+'_content').append('<input type="hidden" id="task_id" value="'+task_id+'" name="form[task_id]" />');
			},
			error:function()
			{
				
			}
		}
	);
	change_fc(id);
}

/**
 * 附件上传后更新平台,这样用户就无需点击提交
 */
 function change_file_zt(data)
 {
		$.ajax
		(
			{
				type:'get',//可选get
				url:'ajax_control.html',//这里是接收数据的PHP程序
				data:'action=tj_cx_files&form[type]=add&form[id]='+save_id+'&form[files_id]='+data.upload_id+'&form[menu_id]='+save_menu_id+'&form[task_id]='+save_task_id,
				dataType:'json',
				success:function(msg)
				{
					show_file_message(msg);
				}
			}
 		);
 }
 
 /**
 * 显示附件信息
 *
 */
 function show_file_message(msg)
 {
	 $('#show_upload_message_sqfj').html('');
	txtHtml = "<table cellspacing='1' cellpadding='1' width='100%'>";
	txtHtml += "<tr>";
	txtHtml += "<th>附件名称</th>";
	txtHtml += "<th>上传时间</th>";
	if(save_id == 'fc_upload')
	{
		txtHtml += "<th>操作</th>";
	}
	
	txtHtml += "</tr>";
	
	for(var key in msg.contents)
	{
		txtHtml += "<tr>";
		txtHtml += "<td><a href='./down_file/?file_id="+msg.contents[key].id+"' target='_self'>"+msg.contents[key].title+"</a></td>";
		txtHtml += "<td>"+msg.contents[key].create_time+"</td>";
		if(save_id == 'fc_upload')
		{
			txtHtml += "<td><a href='javascript:;' onclick='del_file_message(this)'>删除</a><input type='hidden' name='files_arr[]' value='"+msg.contents[key].id+"' /></td>";
		}
		txtHtml += "</tr>";
	}
	$('#show_upload_message_sqfj').html(txtHtml);
 }
 
 /**
 * 删除附件
 *
 */
 function del_file_message(obj,files_id)
 {
	if(confirm('是否确认删除，删除后无法恢复'))
	{
		$(obj).parent().parent().remove();
		
		var eles = document.getElementsByName('files_arr[]');
		var vals = "";
	    for(var i=0;i<eles.length;i++)
	    {
			vals+=eles[i].value+",";
	    }
	    vals = vals.length>0?(vals.substring(0,vals.length-1)):("");
	    
	    $.ajax
		(
			{
				type:'get',//可选get
				url:'ajax_control.html',//这里是接收数据的PHP程序
				data:'action=tj_cx_files&form[type]=update&form[id]='+save_id+'&form[files_id]='+vals+'&form[menu_id]='+save_menu_id+'&form[task_id]='+save_task_id,
				dataType:'json',
				success:function(msg)
				{
					show_file_message(msg);
				}
			}
 		);
	}
 }
 
 /**
 * 删除电子版
 *
 */
 function del_file_doc_message(obj,files_id)
 {
	if(confirm('是否确认删除，删除后无法恢复'))
	{
		$(obj).parent().parent().remove();
		
		var eles = document.getElementsByName('files_doc_arr[]');
		var vals = "";
	    for(var i=0;i<eles.length;i++)
	    {
			vals+=eles[i].value+",";
	    }
	    vals = vals.length>0?(vals.substring(0,vals.length-1)):("");
	    $.ajax
		(
			{
				type:'get',//可选get
				url:'ajax_control.html',//这里是接收数据的PHP程序
				data:'action=tj_cx_files_doc&form[type]=update&form[id]='+save_id+'&form[files_id]='+vals+'&form[menu_id]='+save_menu_id+'&form[task_id]='+save_task_id,
				dataType:'json',
				success:function(msg)
				{
					show_doc_file(msg);
				}
			}
 		);
	}
 }
 
/**
 * 提交修改的内容
 */
function check_user_input_base_fc(fc_type)
{
	$.ajax({
        cache: true,
        type: "POST",
        url:'ajax_control.html',
        data:$('#from_'+fc_type).serialize(),// 你的formid
        async: false,
        dataType:'json',
        error: function(request) {
        	
        },
        success: function(data) {
         
        	  switch(fc_type)
        	  {
        	  	case 'fc_report':
        	  		show_doc_file(data);
        		 break;
        	  	case 'base_fc':
					var task_id = $('#task_id').val();
					$('.cxh_'+task_id).html($('#cxh').val());
        	  	break;
        	  }
       	  	alert(data.return_message);
       		window.open(document.URL,'_self');
        }
    });	
}
/**
 * 显示查新报告电子版
 */
function show_doc_file(msg)
{
	 $('#fc_report_div').html('');
		txtHtml = "<table cellspacing='1' cellpadding='1' width='100%'>";
		txtHtml += "<tr>";
		txtHtml += "<th>附件名称</th>";
		txtHtml += "<th>上传时间</th>";
		if(save_id == 'fc_upload')
		{
			txtHtml += "<th>操作</th>";
		}
		txtHtml += "</tr>";
		for(var key in msg.contents)
		{
			txtHtml += "<tr>";
			txtHtml += "<td><a href='?h=kjcx_report_see&file_id="+msg.contents[key].id+"' target='_self'>"+msg.contents[key].file_name+"</a></td>";
			txtHtml += "<td>"+msg.contents[key].intime+"</td>";
			if(msg.contents[key].del_tag == 1)
			{
				txtHtml += "<td><a href='javascript:;' onclick='del_file_doc_message(this)'>删除</a><input type='hidden' name='files_doc_arr[]' value='"+msg.contents[key].id+"' /></td>";
			}
			
		}
		$('#fc_report_div').html(txtHtml);	
}
//收费
function get_Totalnum(id){
	var cxf	=	$('#'+id+'_cxf').val();
	var jjf =	$('#'+id+'_jjf').val();
	var bgf	=	$('#'+id+'_baogao_fy').val();
	var total_fy = 0;
	
	if(parseInt(cxf) >0 ){total_fy = total_fy+parseInt(cxf);}
	if(parseInt(jjf) >0 ){total_fy = total_fy+parseInt(jjf);}
	if(parseInt(bgf) >0 ){total_fy = total_fy+parseInt(bgf);}
	
	$('#'+id+'_zfy').val(total_fy);
}

function change_fc(id)
{
	$('.fc_content').hide();
	$('.'+id).show();
}
//上传查新文档的操作
upload_tag = 0;
function sc_fun_files()
{
	if(upload_tag == 0)
	{
		if(confirm("是否上传文件？")){upload_tag = 1;ajaxFileUpload_fj_cx('sqfj','cx_file');}
	}
	
}

/**
 * 只能输入数字
 */
function onlyNum()
{
  if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)))
    event.returnValue=false;
}

</script>